#!/bin/bash

help() {
  echo "Usage:"
  echo "  zmicro config set <key> <value>"
  echo ""
  echo "Available Config keys:"
  echo "  ZMICRO_SERVICES_PATH"
}

core() {
  if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
    help
    exit 0
  fi

  local key=$1
  local value=$2
  if [ "$key" = "" ] || [ "$value" = "" ]; then
    log::error "key and value is required"
    log::error ""
    
    help
    exit 1
  fi

  config::set $key $value >> /dev/null 2>&1
}

run() {
  core $@
}

run $@
